home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / pascal / dlgdsn41.zip / TESTCASE.PAS < prev    next >
Pascal/Delphi Source File  |  1993-12-06  |  1KB  |  58 lines

  1. {$X+}
  2. program TestCase;
  3.  
  4. uses Dos, Memory, Objects, Drivers, Views, Menus, Dialogs, App, StdDlg,
  5.      Editors, ColorTxt, InpLong, Validate;
  6.  
  7. Const
  8.   cmTry = 150;
  9.   cmButton = 151;
  10.  
  11. type
  12.   TMyApp = object(TApplication)
  13.     procedure InitStatusLine; virtual;
  14.     procedure HandleEvent(var Event: TEvent); virtual;
  15.     end;
  16.  
  17. var
  18.   MyApp: TMyApp;
  19.  
  20. procedure TMyApp.InitStatusLine;
  21. var R: TRect;
  22. begin
  23.   GetExtent(R);
  24.   R.A.Y := R.B.Y - 1;
  25.   StatusLine := New(PStatusLine, Init(R,
  26.     NewStatusDef(0, $FFFF,
  27.       NewStatusKey('~Alt-X~ Exit', kbAltX, cmQuit,
  28.       NewStatusKey('~F9~ Try dialog', kbF9, cmTry,
  29.       nil)),
  30.     nil)
  31.   ));
  32. end;
  33.  
  34. (*----Insert MakeDialog here----*)
  35.  
  36.  
  37. procedure TMyApp.HandleEvent(var Event: TEvent);
  38. begin
  39. TApplication.HandleEvent(Event);
  40.  
  41. if (Event.What = evCommand) and (Event.Command = cmTry) then
  42.   begin
  43.   if Application^.ExecuteDialog(MakeDialog, @DataRec) = cmOk then
  44.     begin
  45.     {do something with data in DataRec}
  46.     end;
  47.   ClearEvent(Event);
  48.   end;
  49. end;
  50.  
  51. begin
  52.   FillChar(DataRec, Sizeof(DataRec), 0);
  53.   MyApp.Init;
  54.   MyApp.Run;
  55.   MyApp.Done;
  56. end.
  57.  
  58.